<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Product extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('product', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name',30)->comment('商品名称');
            $table->string('description',120)->nullable()->comment('商品描述');
            $table->text('content')->nullable()->comment('商品详情');
            $table->string('thumb_img',150)->nullable()->comment('缩略图');
            $table->string('pro_img')->nullable()->comment('产品图');
            $table->decimal('price')->nullable()->comment('价格');
            $table->smallInteger('nums')->nullable()->default(0)->comment('数量');
            $table->smallInteger('salve_nums')->nullable()->default(0)->comment('已收数量');
            $table->timestamps('datemin')->nullable()->comment('活动开始');
            $table->timestamp('datemax')->nullable()->comment('活动结束');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('Product');
    }
}
